package edu.gdut.thesissys.vo;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * Teacher entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "teacher", catalog = "gdutmis")
public class Teacher extends BaseVo implements java.io.Serializable {

	// Fields

	/**
	 * 
	 */
	private static final long serialVersionUID = -306497566089017983L;
	private String teacherId;
	private CommonGroup commonGroup;
	private Major major;
	private PublicGroup publicGroup;
	private Department department;
	private String name;
	private String sex;
	private String duty;
	private String workUnit;
	private String phone;
	private String powerRight;
	private String password;
	private Integer limitNum;
	private String email;
	private String isCommonLeader;
	private String isPublicLeader;
	private Set<Accreditation> accreditations = new HashSet<Accreditation>(0);
	private Set<StudentChooseTitle> studentChooseTitles = new HashSet<StudentChooseTitle>(
			0);
	private Set<CommonGroup> commonGroups = new HashSet<CommonGroup>(0);
	private Set<PublicGroup> publicGroups = new HashSet<PublicGroup>(0);
	private Set<PaperTitle> paperTitles = new HashSet<PaperTitle>(0);
	private Set<Adjust> adjustsForTeacherIdResponse = new HashSet<Adjust>(0);
	private Set<Adjust> adjustsForTeacherIdRequest = new HashSet<Adjust>(0);
	private Set<MidCheck> midChecks = new HashSet<MidCheck>(0);

	// Constructors

	/** default constructor */
	public Teacher() {
	}

	/** minimal constructor */
	public Teacher(String teacherId, Department department, String name,
			String sex, String duty, String workUnit, String powerRight,
			String password) {
		this.teacherId = teacherId;
		this.department = department;
		this.name = name;
		this.sex = sex;
		this.duty = duty;
		this.workUnit = workUnit;
		this.powerRight = powerRight;
		this.password = password;
	}

	/** full constructor */
	public Teacher(String teacherId, CommonGroup commonGroup, Major major,
			PublicGroup publicGroup, Department department, String name,
			String sex, String duty, String workUnit, String phone,
			String powerRight, String password, Integer limitNum, String email,
			String isCommonLeader, String isPublicLeader,
			Set<Accreditation> accreditations,
			Set<StudentChooseTitle> studentChooseTitles,
			Set<CommonGroup> commonGroups, Set<PublicGroup> publicGroups,
			Set<PaperTitle> paperTitles,
			Set<Adjust> adjustsForTeacherIdResponse,
			Set<Adjust> adjustsForTeacherIdRequest, Set<MidCheck> midChecks) {
		this.teacherId = teacherId;
		this.commonGroup = commonGroup;
		this.major = major;
		this.publicGroup = publicGroup;
		this.department = department;
		this.name = name;
		this.sex = sex;
		this.duty = duty;
		this.workUnit = workUnit;
		this.phone = phone;
		this.powerRight = powerRight;
		this.password = password;
		this.limitNum = limitNum;
		this.email = email;
		this.isCommonLeader = isCommonLeader;
		this.isPublicLeader = isPublicLeader;
		this.accreditations = accreditations;
		this.studentChooseTitles = studentChooseTitles;
		this.commonGroups = commonGroups;
		this.publicGroups = publicGroups;
		this.paperTitles = paperTitles;
		this.adjustsForTeacherIdResponse = adjustsForTeacherIdResponse;
		this.adjustsForTeacherIdRequest = adjustsForTeacherIdRequest;
		this.midChecks = midChecks;
	}

	// Property accessors
	@Id
	@Column(name = "teacher_id", unique = true, nullable = false, length = 10)
	public String getTeacherId() {
		return this.teacherId;
	}

	public void setTeacherId(String teacherId) {
		this.teacherId = teacherId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "common_group_id")
	public CommonGroup getCommonGroup() {
		return this.commonGroup;
	}

	public void setCommonGroup(CommonGroup commonGroup) {
		this.commonGroup = commonGroup;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "major_id")
	public Major getMajor() {
		return this.major;
	}

	public void setMajor(Major major) {
		this.major = major;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "public_group_id")
	public PublicGroup getPublicGroup() {
		return this.publicGroup;
	}

	public void setPublicGroup(PublicGroup publicGroup) {
		this.publicGroup = publicGroup;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "department_id", nullable = false)
	public Department getDepartment() {
		return this.department;
	}

	public void setDepartment(Department department) {
		this.department = department;
	}

	@Column(name = "name", nullable = false, length = 10)
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "sex", nullable = false, length = 2)
	public String getSex() {
		return this.sex;
	}

	public void setSex(String sex) {
		this.sex = sex;
	}

	@Column(name = "duty", nullable = false, length = 8)
	public String getDuty() {
		return this.duty;
	}

	public void setDuty(String duty) {
		this.duty = duty;
	}

	@Column(name = "work_unit", nullable = false, length = 30)
	public String getWorkUnit() {
		return this.workUnit;
	}

	public void setWorkUnit(String workUnit) {
		this.workUnit = workUnit;
	}

	@Column(name = "phone", length = 11)
	public String getPhone() {
		return this.phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	@Column(name = "power_right", nullable = false, length = 1)
	public String getPowerRight() {
		return this.powerRight;
	}

	public void setPowerRight(String powerRight) {
		this.powerRight = powerRight;
	}

	@Column(name = "password", nullable = false, length = 32)
	public String getPassword() {
		return this.password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	@Column(name = "limit_num")
	public Integer getLimitNum() {
		return this.limitNum;
	}

	public void setLimitNum(Integer limitNum) {
		this.limitNum = limitNum;
	}

	@Column(name = "email", length = 30)
	public String getEmail() {
		return this.email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	@Column(name = "is_common_leader", length = 1)
	public String getIsCommonLeader() {
		return this.isCommonLeader;
	}

	public void setIsCommonLeader(String isCommonLeader) {
		this.isCommonLeader = isCommonLeader;
	}

	@Column(name = "is_public_leader", length = 1)
	public String getIsPublicLeader() {
		return this.isPublicLeader;
	}

	public void setIsPublicLeader(String isPublicLeader) {
		this.isPublicLeader = isPublicLeader;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "teacher")
	public Set<Accreditation> getAccreditations() {
		return this.accreditations;
	}

	public void setAccreditations(Set<Accreditation> accreditations) {
		this.accreditations = accreditations;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "teacher")
	public Set<StudentChooseTitle> getStudentChooseTitles() {
		return this.studentChooseTitles;
	}

	public void setStudentChooseTitles(
			Set<StudentChooseTitle> studentChooseTitles) {
		this.studentChooseTitles = studentChooseTitles;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "teacher")
	public Set<CommonGroup> getCommonGroups() {
		return this.commonGroups;
	}

	public void setCommonGroups(Set<CommonGroup> commonGroups) {
		this.commonGroups = commonGroups;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "teacher")
	public Set<PublicGroup> getPublicGroups() {
		return this.publicGroups;
	}

	public void setPublicGroups(Set<PublicGroup> publicGroups) {
		this.publicGroups = publicGroups;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "teacher")
	public Set<PaperTitle> getPaperTitles() {
		return this.paperTitles;
	}

	public void setPaperTitles(Set<PaperTitle> paperTitles) {
		this.paperTitles = paperTitles;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "teacherByTeacherIdResponse")
	public Set<Adjust> getAdjustsForTeacherIdResponse() {
		return this.adjustsForTeacherIdResponse;
	}

	public void setAdjustsForTeacherIdResponse(
			Set<Adjust> adjustsForTeacherIdResponse) {
		this.adjustsForTeacherIdResponse = adjustsForTeacherIdResponse;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "teacherByTeacherIdRequest")
	public Set<Adjust> getAdjustsForTeacherIdRequest() {
		return this.adjustsForTeacherIdRequest;
	}

	public void setAdjustsForTeacherIdRequest(
			Set<Adjust> adjustsForTeacherIdRequest) {
		this.adjustsForTeacherIdRequest = adjustsForTeacherIdRequest;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "teacher")
	public Set<MidCheck> getMidChecks() {
		return this.midChecks;
	}

	public void setMidChecks(Set<MidCheck> midChecks) {
		this.midChecks = midChecks;
	}

}